<!doctype html>
<html>
<head>
	<title>{$data.cate_name}</title>
	<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
	<meta name="format-detection" content="telephone=no"/> <!--禁止数字串在ok手机中被识别成电话号码-->
	<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
	<!-- ICO -->
	<link rel="stylesheet" href="favicon.ico">
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/mobile/main.css" media="all" />
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/mobile/style.css" media="all" />
	<!-- iconfont图形样式 -->
	<link rel="stylesheet" href="__PUBLIC__/css/mobile/iconfont/iconfont.css" type="text/css">
	<style type="text/css">
		.btn-primary {
		    color: #fff;
		    background-color: #43ac43;
		    border: 1px solid rgba(0,0,0,0.05);
		}
		.tohide{display: none;}
	</style>
</head>
<body>
<!-- <div class="tohide">
	<div class="item-input">
		<input type="radio" name="normal" value="male">灯纸潮湿失效
		<br>
		<input type="radio" name="normal" value="female">临界最长更换期
		<br>
		<input type="radio" name="normal" value="female">灯纸粉尘过多失效
	</div>
</div> -->
<div class="main">
<!--header页头文件开始-->
	<div class="header">
		<p><strong>{$data.name}</strong></p>
	</div><!--header页头文件结束-->
	<!--mainBody文件开始-->
	<div class="mainbody">
		<p class="red size">请认真填写，谢谢！</p>
		<div class="items clear">
			<div class="left item"><!--左边设备情况表-->
				<p class="tiem-font-size">设备情况</p>
				<div class="item-input">
					<foreach name="status" item="st">
						<input type="hidden" name="status_one[]" value="">
						<input type="checkbox" class="device_status" id="one{$key}" data-next={$st.is_next} name="{$st.status_name}" value="{$st.id}" onclick="two_status(this)">&nbsp;{$st.status_name}
					<br>
					</foreach>
					<!-- 正&emsp;常&emsp;<input type="radio" name="normal" value="male">
					<br>
					换灯纸&emsp;<input type="radio" name="normal" value="female">
					<br>
					异&emsp;常&emsp;<input type="radio" name="normal" value="female"> -->
				</div>
				<br>
				<div class="item-sm">
					<p>说明：可以同时勾选多项，异常和正常不能同时勾选</p>
				</div>
			</div>
			<div class="right item"><!--右边捕获情况表-->
				<p class="tiem-font-size">捕获情况</p>
				<div class="item-table">
					<table class="table-catch">
						<tr class="">
							<th>种类</th>
							<th>数量</th>
						</tr>
						<foreach name="pest_name" item="pn">
							<tr>
								<td>{$pn.name}</td>
								<td><input type="text" class="pest" data-id="{$pn.id}" name="{$pn.name}" placeholder="0"></td>
							</tr>
						</foreach>
						
						<!-- <tr>
							<td>蝇类</td>
							<td><input type="text" name="" placeholder="0"></td>
						</tr>
						<tr>
							<td>蚊类</td>
							<td><input type="text" name="" placeholder="0"></td>
						</tr>
						<tr>
							<td>蛾类</td>
							<td><input type="text" name="" placeholder="0"></td>
						</tr>
						<tr>
							<td>其他</td>
							<td><input type="text" name="" placeholder="0"></td>
						</tr> -->
					</table>
				</div>
			</div>
		</div>
	</div><!--mainBody文件结束-->

</div>
<!--footer底部文件-->
<div class="device-foot clear">
	<a href="" id="submit" class="btn btn-primary">提交</a>
</div>
<script src="__PUBLIC__/js/jquery-1.10.1.min.js" type="text/javascript"></script>
	<script src="__PUBLIC__/js/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/plugins/layer/layer.min.js"></script>
<script type="text/javascript">
	function two_status(obj){
		var is_choose = $(obj).attr('checked');
		//判断正常和异常，两个不能同时选择
		if (is_choose == 'checked'){
			var this_id = $(obj).attr('id');
			
			//如果当前的id值为one0，则为正常情况，先判断异常one1是否已经选中
			if (this_id == "one0") {
				//检查异常项是否被选中
				var one1 = $("#one1").attr("checked");
				if (one1 == 'checked') {
					$(obj).removeAttr('checked');
					layer.msg("正常异常不能同时选择");
					return false;
				}

			}
			//如果当前的id值为one1，则为异常情况情况，先判断异常one0是否已经选中
			if (this_id == "one1") {
				//检查异常项是否被选中
				var one0 = $("#one0").attr("checked");
				if (one0 == 'checked') {
					$(obj).removeAttr('checked');
					layer.msg("正常异常不能同时选择");
					return false;
				}

			}
		}
		if (is_choose == 'checked') {
			/*$(obj).removeAttr('checked');*/
			/*return false;*/
			var id = $(obj).val();
			var url = '__MODULE__/Device/status/id/' + id;
			layer.open({
				  type: 2,
				  area: ['90%', '50%'],
				  fixed: false, //不固定
				  maxmin: true,
				  content: url
			});
			return false;
		}
	};
	/*$(document).on('click','.device_status',function(){
			var id = $(this).val();
			layer.open({
			  type: 2,
			  area: ['90%', '50%'],
			  fixed: false, //不固定
			  maxmin: true,
			  content: '__MODULE__/Device/status/id' + id
			});
			return false;
		});*/
	
</script>
</body>
</html>